<template>
  <t-config-provider :global-config="getComponentsLocale">
    <router-view :key="locale" :class="[mode]" />
  </t-config-provider>
</template>

<script setup lang="ts">
import { computed } from 'vue';

import { useLocale } from '@/locales/useLocale';
import { useSettingStore } from '@/store';

const store = useSettingStore();

const mode = computed(() => {
  return store.displayMode;
});

console.log(import.meta.env.VITE_PROXY_API_URL);

const { getComponentsLocale, locale } = useLocale();

// if (process.env.NODE_ENV !== 'development') {
//   (() => {
//     let handler = setInterval(() => {
//       let debugflag = true;
//       if (window.outerWidth - window.innerWidth > 210 || window.outerHeight - window.innerHeight > 210) {
//         document.getElementsByTagName("body")[0].innerHTML = '检测到非法调试, 请关闭调试终端后刷新本页面重试!<br/>Welcome for People, Not Welcome for Machine!<br/>';

//         debugflag = true
//       }
//       let before = new Date();
//       (function () {
//       }
//       ["constructor"]("debugger")());
//       let after = new Date();
//       let cost = after.getTime() - before.getTime();
//       if (cost > 50) {
//         debugflag = true;
//         try {
//           document.getElementsByTagName("body")[0].innerHTML = '检测到非法调试, 请关闭调试终端后刷新本页面重试!<br/>Welcome for People, Not Welcome for Machine!<br/>';
//           document.write('检测到非法调试, 请关闭调试终端后刷新本页面重试!<br/>');
//           document.write("Welcome for People, Not Welcome for Machine!<br/>")
//         } catch (err) {
//           alert('检测到非法调试, 请关闭调试终端后刷新本页面重试!')
//         }
//       }
//     }
//       , 2000)

//     if (window.outerWidth - window.innerWidth > 210 || window.outerHeight - window.innerHeight > 210) {
//       document.getElementsByTagName("body")[0].innerHTML = '检测到非法调试, 请关闭调试终端后刷新本页面重试!<br/>Welcome for People, Not Welcome for Machine!<br/>';
//       window.location.href = "about:blank";
//     }
//   })()
// }
</script>
<style lang="less" scoped>
#nprogress .bar {
  background: var(--td-brand-color) !important;
}
</style>
